POV-Ray : Newsgroups : povray.general : how to call multiple instances of a macro? : Re: how to call multiple instances of a macro? Server Time
30 Jul 2024 12:28:02 EDT (-0400)
  Re: how to call multiple instances of a macro?  
From: Christian Froeschlin
Date: 15 Feb 2009 11:19:33
Message: <49984095@news.povray.org>
[GDS|Entropy] wrote:
> I have the following macro, but I can't call multiple instances of it 
> without overriding the previous values...how can I rewrite this macro to fix 
> this?

Try something like this:

#macro Fill(A,N)
   #local i = 0;
   #while (i < N)
     #declare A[i] = i;
     #local i = i + 1;
   #end
#end

#declare Sp = 60;
#declare randVectArray = array[Sp];
Fill(randVectArray, Sp)

#declare Sp2 = 50;
#declare randVectArray2 = array[Sp2];
Fill(randVectArray2, Sp2)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.